package com.atguigu.petstore.feign.member;

import com.atguigu.petstore.common.result.Result;
import com.atguigu.petstore.member.entity.MemberInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author lfy
 * @Description
 * @create 2023-09-27 14:22
 */
@FeignClient(value = "member-service")
public interface MemberFeignClient {


    /**
     * 按照手机号登录查询用户信息
     * @param phone
     * @return
     */
    @GetMapping("/rpc/member/info/{phone}")
    Result<MemberInfo>  getMemeberByPhone(@PathVariable("phone") String phone);


    /**
     * 按照手机号注册用户信息
     * @param phone
     * @return 注册成功后返回刚才注册好的完整用户
     */
    @PostMapping("/rpc/member/register/{phone}")
    Result<MemberInfo> register(@PathVariable("phone") String phone);


}
